﻿<?php
$this->breadcrumbs=array(
	'Cv',
);?>

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/cv.css" />

<script type='text/javascript' src="<?php echo Yii::app()->theme->baseUrl; ?>/fullCalendar/fullcalendar/fullcalendar.js"></script>
<link rel='stylesheet' type='text/css' href="<?php echo Yii::app()->theme->baseUrl; ?>/css/jquery-ui-1.8.14.custom.css" />
<script type='text/javascript' src="<?php echo Yii::app()->theme->baseUrl; ?>/fullCalendar/jquery/jquery-ui-1.8.11.custom.min.js"></script>
<script type='text/javascript' src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.ui.datepicker.js"></script>

<script type = 'text/javascript'>
	$(document).ready(function(){
		$('input:visible:first').focus();
		$('input[type="text"], input[type="password"], textarea,  select').blur(function() {
				$('input[type="text"], input[type="password"], textarea,  select').removeClass('focus');
				$(this).addClass('unFocus');
			})
			.focus(function() {
				$(this).addClass('focus');
				$(this).removeClass('unFocus');
			
			});
		$("#birthday, #idCreated").datepicker(
			{
			defaultDate: "+1w",
			dateFormat: 'yy-mm-dd',
			changeMonth: true,
			numberOfMonths: 1,
			showOn: 'both',
			buttonImageOnly: true,
			changeMonth: true,
			buttonText:'Select date',
			buttonImage: '<?php echo Html::imageUrl("icon_calendar.gif");?>'	
			}
		);
		
		$('.plus').hide();
		$("#infoToggle").click(function(){
			
			if($($("#personalInfo")).is(":visible"))
			{
				$(this).children(".minus").hide();
				$(this).children(".plus").show();
			}else
			{
				$(this).children(".minus").show();
				$(this).children(".plus").hide();
			}
			$("#personalInfo").slideToggle("fast");
		});
		
		$("#contactToggle").click(function(){
			
			if($($("#contactInfo")).is(":visible"))
			{
				$(this).children(".minus").hide();
				$(this).children(".plus").show();
			}else
			{
				$(this).children(".minus").show();
				$(this).children(".plus").hide();
			}		
			$("#contactInfo").slideToggle("slow");
		});
	});	
</script>
	
    <div class="padding10"></div>
	<div id="contentWrapper">
		<!--<div id="rightHeader">
     	  	<h2>Sơ yếu lí lịch</h2>
      	</div>
      	
      	--><!-- Begin rightWrapper -->
		<div id="rightWrapper">
			<?php
				$uid= Yii::app()->request->getParam('uid'); 
				 $form = $this->beginWidget('CActiveForm',
				 array('action'=>$this->createUrl('/profile/cv/add',
				 array('uid'=>$uid)),
				 'enableAjaxValidation'=>false,
				 )); 
			?>	
			<fieldset>
				<legend id="infoToggle">
					<img class="minus" title ="thu gọn" src="<?php echo Html::imageUrl("minus.gif");?>" ></img>
					<img class="plus" title ="mở rộng" src="<?php echo Html::imageUrl("plus.gif");?>" ></img>
					Thông tin cá nhân	
				</legend>
				
				<table id="personalInfo">
					<tr>
						<td class="leftCol">Họ tên:</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_user_name');?>
							<?php echo $form->error($UserProfile,'user_profile_user_name',array('class' => 'formError'));?>
						</td>
					</tr>
					<tr>
						<td class="leftCol">Ngày sinh:</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_user_date_of_birth', array('id'=>'birthday'));?>
							&nbsp (yyyy/mm/dd) 
						</td>
					</tr>
					<tr>
						<td class="leftCol">Giới tính</td>
						<td class="rightCol">
							<?php echo $form->dropDownList($UserProfile,'user_profile_user_gender',$Gender )?>
						</td>
					</tr>
					<tr>
						<td class="leftCol">Dân tộc</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_ethnic');?>
						</td>
					</tr>
					<tr>
						<td class="leftCol">Số CMND</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_user_idcard');?>
						</td>
					</tr>
					<tr>
						<td class="leftCol">Ngày cấp</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_user_idcard_date', array('id'=>'idCreated'));?>
							&nbsp (yyyy/mm/dd) 
						</td>
					</tr>
					<tr>
						<td class="leftCol">Nơi cấp</td>
						<td class="rightCol">
							<?php echo $form->dropDownList($UserProfile,'user_profile_user_idcard_place',$provinceList, array('class'=>'selectProvince') )?>
						</td>
					</tr>
				</table>
			</fieldset>
			
			
			<!-- Begin contact info -->
			<fieldset>
				<legend id = "contactToggle">
					<img class="minus" title ="thu gọn" src="<?php echo Html::imageUrl("minus.gif");?>" ></img>
					<img class="plus" title ="mở rộng" src="<?php echo Html::imageUrl("plus.gif");?>" ></img>
				Thông tin liên lạc
				</legend>
				
				<table id="contactInfo">
					<tr>
						<td class="leftCol"></td>
						<td class="contactHeader">Nguyên quán</td>
						<th class="thirdCol"></th>
					</tr>
					
					<tr>
						<td class="leftCol">Địa chỉ</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_birth_place');?>
						</td>
						<td></td>
					</tr>
					<tr>
						<td class="leftCol">Tỉnh/thành phố:</td>
						<td class="rightCol">
							<?php echo $form->dropDownList($UserProfile,'user_profile_birth_place_province_id',$provinceList, array('class'=>'selectProvince'))?>
						</td>
						<td></td>
					</tr>
					<tr>
						<td class="lineAddress" colspan="3">
                        </td>
                    </tr>
                        
                   	<tr>
						<td class="leftCol"></td>
						<td class="contactHeader">Địa chỉ liên lạc</td>
						<td></td>
					</tr>
					<tr>
						<td class="leftCol">Số điện thoại</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_phone_number');?>
						</td>
						<td></td>
					</tr>
					<tr>
						<td class="leftCol">Email</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_email');?>
						</td>
						<td></td>
					</tr>
					
					<tr>
						<td class="leftCol">Địa chỉ</td>
						<td class="rightCol">
							<?php echo $form->textField($UserProfile,'user_profile_adress');?>
						</td>
						<td></td>
					</tr>
						
					<tr>
						<td class="leftCol">Tỉnh/thành phố:</td>
						<td class="rightCol">
							<?php echo $form->dropDownList($UserProfile,'user_profile_adress_province_id',$provinceList, array('class'=>'selectProvince')); ?>
						</td>
						<td></td>
					</tr>
					
				</table>
			</fieldset>
			<!-- End contact info -->
			<?php 
				echo CHtml::submitButton('Lưu', array('class'=>'buttonSave'));
				echo CHtml::resetButton('Làm lại', array('class'=>'buttonReset'));
			?>
			<?php $this->endWidget();?>
		</div>
		<!-- End rightWrapper -->
     </div>
     <!-- End rightSidebar -->
